<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      Mercurial-5.3
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.79.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-9.1">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 9.1
      </h4>
      <h3>
        Chapter&nbsp;13.&nbsp;Programming
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="lua52.html" title="Lua-5.2.4">Prev</a>
          <p>
            Lua-5.2.4
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="nasm.html" title="NASM-2.14.02">Next</a>
          <p>
            NASM-2.14.02
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="prog.html" title=
          "Chapter&nbsp;13.&nbsp;Programming">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="mercurial" name="mercurial"></a>Mercurial-5.3
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <h2 class="sect2">
          Introduction to Mercurial
        </h2>
        <p>
          <span class="application">Mercurial</span> is a distributed source
          control management tool similar to <span class=
          "application">Git</span> and <span class=
          "application">Bazaar</span>. <span class=
          "application">Mercurial</span> is written in <span class=
          "application">Python</span> and is used by projects such as Mozilla
          and Vim.
        </p>
        <p>
          This package is known to build and work properly using an LFS-9.1
          platform.
        </p>
        <h3>
          Package Information
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Download (HTTP): <a class="ulink" href=
                "https://www.mercurial-scm.org/release/mercurial-5.3.tar.gz">https://www.mercurial-scm.org/release/mercurial-5.3.tar.gz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download MD5 sum: 8a0b590f081130969cf07248a072a4cf
              </p>
            </li>
            <li class="listitem">
              <p>
                Download size: 7.2 MB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated disk space required: 77 MB (with docs, add 878 MB
                for tests)
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated build time: 0.5 SBU (with docs, add 11 SBU for
                tests using -j4)
              </p>
            </li>
          </ul>
        </div>
        <h3>
          Mercurial Dependencies
        </h3>
        <h4>
          Required
        </h4>
        <p class="required">
          <a class="xref" href="python2.html" title=
          "Python-2.7.17">Python-2.7.17</a>
        </p>
        <h4>
          Optional
        </h4>
        <p class="optional">
          <a class="xref" href="python-modules.html#docutils" title=
          "docutils-0.16">docutils-0.16</a> (required to build the
          documentation), <a class="xref" href="git.html" title=
          "Git-2.25.0">git-2.25.0</a>, <a class="xref" href=
          "../postlfs/gnupg.html" title="GnuPG-2.2.19">GnuPG-2.2.19</a>
          (<span class="command"><strong>gpg2</strong></span> with Python
          bindings), <a class="xref" href="../postlfs/openssh.html" title=
          "OpenSSH-8.2p1">OpenSSH-8.2p1</a> (runtime, to access ssh://...
          repositories), <a class="xref" href="python-modules.html#pygments"
          title="Pygments-2.5.2">Pygments-2.5.2</a>, <a class="xref" href=
          "subversion.html" title="Subversion-1.13.0">Subversion-1.13.0</a>
          (with Python bindings), <a class="ulink" href=
          "https://launchpad.net/bzr">Bazaar</a>, <a class="ulink" href=
          "http://www.nongnu.org/cvs/">CVS</a>, <a class="ulink" href=
          "https://pypi.python.org/pypi/pyflakes">pyflakes</a>, and <a class=
          "ulink" href="https://github.com/pyca/pyopenssl">pyOpenSSL</a>
        </p>
        <p class="usernotes">
          User Notes: <a class="ulink" href=
          "http://wiki.linuxfromscratch.org/blfs/wiki/mercurial">http://wiki.linuxfromscratch.org/blfs/wiki/mercurial</a>
        </p>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installation of Mercurial
        </h2>
        <p>
          Build <span class="application">Mercurial</span> by issuing the
          following command:
        </p>
        <pre class="userinput">
<kbd class="command">make build</kbd>
</pre>
        <p>
          To build the documentation (requires <a class="xref" href=
          "python-modules.html#docutils" title=
          "docutils-0.16">docutils-0.16</a>), issue:
        </p>
        <pre class="userinput">
<kbd class="command">2to3 -w doc/hgmanpage.py &amp;&amp;
PYTHON=python3 make doc</kbd>
</pre>
        <p>
          To run the test suite, issue:
        </p>
        <pre class="userinput">
<kbd class="command">rm -rf tests/tmp &amp;&amp;
TESTFLAGS="-j<em class=
"replaceable"><code>&lt;N&gt;</code></em> --tmpdir tmp --blacklist blacklists/fsmonitor --blacklist blacklists/linux-vfat" make check</kbd>
</pre>
        <p>
          where <em class="replaceable"><code>&lt;N&gt;</code></em> is an
          integer between one and the number of ( processor X threads ),
          inclusive. In order to investigate any apparently failing tests,
          you may use the <span class=
          "command"><strong>run-tests.py</strong></span> script. To see the
          almost forty switches, some of them very useful, issue <span class=
          "command"><strong>tests/run-tests.py --help</strong></span>.
          Running the following commands, you will execute only the tests
          that failed before:
        </p>
        <pre class="userinput">
<kbd class="command">pushd tests  &amp;&amp;
  rm -rf tmp &amp;&amp;
  ./run-tests.py --tmpdir tmp test-gpg.t
popd</kbd>
</pre>
        <p>
          Normally, the previous failures will be confirmed. However, if you
          add the switch "--debug" before "--tmpdir", and run again, some
          failures are gone, which seems to be a problem with the test suite.
          If this happens, normally, from now on, there will be no more such
          failures whether you use the debug switch or not. Three tests,
          test-alias.t, test-install.t, and test-bundle2-exchange.t
          (intermittently), are known to fail.
        </p>
        <p>
          An interesting switch is "--time", which will generate at the end
          of the test suite execution, a table with all executed tests and
          respective start, end, user, system and real times. Note that the
          switches may be used with <span class="command"><strong>make
          check</strong></span> by including them in the <code class=
          "envar">TESTFLAGS</code> environment variable.
        </p>
        <p>
          Install <span class="application">Mercurial</span> by running the
          following command (as <code class="systemitem">root</code>):
        </p>
        <pre class="root">
<kbd class="command">make PREFIX=/usr install-bin</kbd>
</pre>
        <p>
          If you built the documentation, install it by running the following
          command (as <code class="systemitem">root</code>):
        </p>
        <pre class="root">
<kbd class="command">make PREFIX=/usr install-doc</kbd>
</pre>
        <p>
          After installation, two very quick and simple tests should run
          correctly. The first one needs some configuration:
        </p>
        <pre class="userinput">
<kbd class="command">cat &gt;&gt; ~/.hgrc &lt;&lt; "EOF"
<code class="literal">[ui]
username = <em class=
"replaceable"><code>&lt;user_name&gt; &lt;user@mail&gt;</code></em></code>
EOF</kbd>
</pre>
        <p>
          where you must replace &lt;user_name&gt; and &lt;your@mail&gt;
          (mail is optional and can be omitted). With the user identity
          defined, run <span class="command"><strong>hg
          debuginstall</strong></span> and several lines will be displayed,
          the last one reading "no problems detected". Another quick and
          simple test is just <span class=
          "command"><strong>hg</strong></span>, which should output basic
          commands that can be used with <span class=
          "command"><strong>hg</strong></span>.
        </p>
      </div>
      <div class="commands" lang="en" xml:lang="en">
        <h2 class="sect2">
          Command Explanations
        </h2>
        <p>
          <span class="command"><strong>2to3 -w
          doc/hgmanpage.py</strong></span>: Since <span class=
          "application">Python 3</span> is used with docutils, one file needs
          to be converted in order to be compatible.
        </p>
      </div>
      <div class="configuration" lang="en" xml:lang="en">
        <h2 class="sect2">
          Configuring Mercurial
        </h2>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3">
            <a id="mercurial-config" name="mercurial-config"></a>
          </h3>
          <h4 class="title">
            <a id="mercurial-config" name="mercurial-config"></a>Config Files
          </h4>
          <p>
            <code class="filename">/etc/mercurial/hgrc</code> and
            <code class="filename">~/.hgrc</code>
          </p>
          <p>
            The great majority of extensions are disabled by default. Run
            <span class="command"><strong>hg help extensions</strong></span>
            if you need to enable any, e.g. when investigating test failures.
            You will obtain the lists of enabled and disabled extensions, and
            more information, such as how to enable or disable them using
            configuration files.
          </p>
          <p>
            If you have installed <a class="xref" href=
            "../postlfs/make-ca.html" title="make-ca-1.5">make-ca-1.5</a> and
            want <span class="application">Mercurial</span> to use them, as
            the <code class="systemitem">root</code> user, issue:
          </p>
          <pre class="root">
<kbd class="command">install -v -d -m755 /etc/mercurial &amp;&amp;
cat &gt; /etc/mercurial/hgrc &lt;&lt; "EOF"
<code class="literal">[web]
cacerts = /etc/pki/tls/certs/ca-bundle.crt</code>
EOF</kbd>
</pre>
        </div>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          Contents
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed Programs:</strong>
              <span class="segbody">hg</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Libraries:</strong>
              <span class="segbody">several internal modules under
              /usr/lib/python2.7/site-packages/mercurial</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Directories:</strong>
              <span class="segbody">/etc/mercurial and
              /usr/lib/python2.7/site-packages/{hgdemandimport,hgext,hgext3rd,mercurial}</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0" class="variablelist">
            <colgroup>
              <col align="left" valign="top" />
              <col />
            </colgroup>
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="hg" name="hg"></a><span class="term"><span class=
                    "command"><strong>hg</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the mercurial version control system.
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <p class="updated">
        Last updated on 2020-02-19 08:47:37 -0800
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="lua52.html" title="Lua-5.2.4">Prev</a>
          <p>
            Lua-5.2.4
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="nasm.html" title="NASM-2.14.02">Next</a>
          <p>
            NASM-2.14.02
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="prog.html" title=
          "Chapter&nbsp;13.&nbsp;Programming">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
